package com.googlecode.astoolkit.modules.content{
	
	import com.googlecode.astoolkit.modules.content.model.ContentModel;
	import com.googlecode.astoolkit.utils.Sitemap;
	import com.googlecode.astoolkit.vo.ParamsObject;
	import com.googlecode.astoolkit.vo.PathObject;
	
	import flash.display.Sprite;
	
	public class ContentModule extends Sprite {
		
		private var _model:ContentModel;
		private var _view:MainSection;

		public function ContentModule() {
			super();
			
			_model = ContentModel.getInstance();
			//_model.setData(Sitemap.xml);
			
			_view = new MainSection();
			_view.init(Sitemap.nodes[0]);
			addChild(_view);
			
			_model.addEventListener(ContentEvents.PATH_CHANGED, _view.onPathChanged);
		}
		
		public function changePath(path:String, params:ParamsObject=null):void {
			//trace("path-->" + path);
			_model.onPathChanged(new PathObject(path, params));
		} 

	}
}